package com.yuandian.management.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuandian.management.mapper.CommonInterfaceMapper;
import com.yuandian.management.service.ICommonInterfaceService;
import com.yuandian.api.management.entity.CommonInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 说明：通用接口配置服务实现
 * @Author zfsn
 * @Date 2023/2/20 19:59
 */
@Service
public class CommonInterfaceServiceImpl extends ServiceImpl<CommonInterfaceMapper, CommonInterface>
		implements ICommonInterfaceService {

	@Autowired
	private CommonInterfaceMapper commonInterfaceMapper;

	/**
	 * 通过配置编码获取通用接口配置
	 * @param code 配置编码
	 * @return 通用接口配置
	 */
	@Override
	public CommonInterface getByCode(String code) {
		QueryWrapper<CommonInterface> wrapper = new QueryWrapper<>();
		wrapper.eq("code", code);
		return getOne(wrapper);
	}
}
